<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<title>股转系统挂牌公司信息抓取工具</title>

<style type="text/css">
	table{
		width: 100%;
	}
	td{
		border:1px solid #666;
	}
	table>tr:FIRST-CHILD {
		text-align: right;	
	}

</style>
<link href="https://cdn.bootcss.com/Buttons/2.0.0/css/buttons.min.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.js"></script>
<script src="https://cdn.bootcss.com/layer/3.0.3/layer.min.js"></script>
<script type="text/javascript">
	$(function() {
		//挂牌公司转让类型
		loadSelBydiccode('listtrans_type');
		//行业类型
		loadSelBydiccode('profession_type');
		//地区
		loadDq();
		//主办券商
		loadZBQS();
		
		$("form").submit(function(){
			var m="post";
			if($(this).attr("method")!=''&&$(this).attr("method")!=undefined){
				m=$(this).attr("method");	
			}
			if($(this).attr("action")==''||$(this).attr("action")==undefined){
				alert("Error:缺失提交地址");
				return false;
			}
   			$.ajax({
   				method:m,
   				url:$(this).attr("action"),
   				data:$(this).serializeArray(),
   				success:function(msg){
   					if(msg=="success"){
   						layer.msg("任务开始执行.");
   					}
   				},
   				error:function(err){
   					alert(err);
   				}
   			});
   			return false;
		});
		$(".showState").text("已加载所有任务条件...");
		startListenerTask();
	});
	var listenerTaskObj;
	var startListenerTask=function(){
		listenerTaskObj=setInterval(function() {
			$.post("crawler_task_listener.do",{},function(msg){
					$(".showState").html(msg);
			});
		},1000);
	};
function loadSelBydiccode(dictionaryCode){
	$.ajax({
		url : 'http://www.neeq.com.cn/listedDictionary/getDic.do',
		data:{
			dictCode : dictionaryCode
		},
		dataType : 'jsonp',
		async: false,
		success : function(result) {
			var source= "";
			for (var i = 0; i < result.length; i++) {
				source +="<option value="+result[i].dvalue+">"+result[i].dkey+"</option>"
			}
			if (dictionaryCode == 'listtrans_type'){
				$("#dicXxzrlx").empty();
				$("#dicXxzrlx").append("<option value=''>全部</option>");
				$("#dicXxzrlx").append(source);
			}else if (dictionaryCode == 'profession_type') {
				$("#dicXxhyzl").empty();
				$("#dicXxhyzl").append("<option value=''>全部</option>");
				$("#dicXxhyzl").append(source);
			}
		}
	});
}

function loadDq(){
	$.ajax({
		url : 'http://www.neeq.com.cn/listedDictionary/getXxssdq.do',
		dataType : 'jsonp',
		async: false,
		success : function(result) {
			var source= "";
			if (result != null && result != ""){
				for (var i = 0; i < result.length; i++) {
					source +="<option value="+result[i].xxssdq+">"+result[i].xxssdq+"</option>"
				}
			}
			
			$("#dicXxssdq").empty();
			$("#dicXxssdq").append("<option value=''>全部</option>");
			$("#dicXxssdq").append(source);
		}
	});
}

 var loadZBQS=function(){
	$.ajax({
		url : 'http://www.neeq.com.cn/nqxxController/getXxzbqs.do',
		dataType : 'jsonp',
		async: false,
		success : function(result) {
			var source= "";
			if (result != null && result != ""){
				for (var i = 0; i < result.length; i++) {
					source +="<option value="+result[i].xxzbqs+">"+result[i].xxzbqs+"</option>"
				}
			}
			$("#dicXxzbqs").empty();
			$("#dicXxzbqs").append("<option value=''>全部</option>");
			$("#dicXxzbqs").append(source);
		}
	});
};
</script>
</head>
<body>
	<h2 style="width:100%;text-align: center;color:#ccc;">股转系统挂牌公司信息抓取工具</h2>
	<form class="form" action="crawler_info_services.do" method="post">
		
	<table>
		<tr>
			<td colspan="2">
				<h3>选择任务条件</h3>
			</td>
		 </tr>
		<tr class="layui-form">
			 <td>
			 	转让类型:
			 </td>
			 <td class="layui-inline">
			 	<select id="dicXxzrlx" name="dicXxzrlx"></select>
			 </td>
		</tr>
		<tr>
			<td>行业种类:</td>
			<td><select id="dicXxhyzl" name="dicXxhyzl"></select></td>
		</tr>
		<tr>
			<td> 地   区     :</td>
			<td><select id="dicXxssdq" name="dicXxssdq"></select></td>
		</tr>
		<tr>
			<td>主办券商:</td>
			<td><select id="dicXxzbqs" name="dicXxzbqs"></select></td>
		</tr>
		<tr>
			<td>公司类型:</td>
			<td>
				<input name="xxfcbj" class="xxfcbj" value="" type="radio" checked="checked">
				<span>全部</span>
				<input name="xxfcbj" class="xxfcbj" value="1" type="radio">
				<span>创新层</span>
				<input name="xxfcbj" class="xxfcbj" value="0" type="radio"  >
				<span>基础层</span>
			</td>
		</tr>
		<tr style="">
			<td>下载文件类型:</td>
			<td>
			<input name="fileType" class="fileType" value="公开转让说明书" type="checkbox" checked="checked">
			<span>公开转让书</span>
			<input name="fileType" class="fileType" value="年年度报告" type="checkbox" checked="checked">
			<span>年度报告</span>
			<input name="fileType" class="fileType" value="年半年度报告" type="checkbox"  checked="checked">
			<span>半年度报告</span>
			</td>
		</tr>
		<tr style="">
			<td>检索关键字补充:</td>
			<td>
			<input name="gjz" class="gjz" value="" type="text" style="min-width:300px;" placeholder="以 , 逗号 分隔" >
			<font color="red">注：多个关键字以     ,  (逗号) 做分隔。</font>
			<br>
			<p>已有检索项:"#存在邮箱","董事会秘书","#固定电话",
			"#手机号","主办券商","邮编","证券代码",
			"邮箱","联系方式","电话","营业收入","律师"</p>
			</td>
		</tr>
		<tr>
			<td colspan="2" style="text-align: center;">
				<input type="submit" value="抓取" class="submit button button-primary button-pill button-small" />
				<a class="button button-primary button-pill button-small" href="crawler_info_services_reset.do" target="_blank">重置任务</a>
				<a class="button button-primary button-pill button-small" href="crawler_info_services_stop.do" target="_blank">停止任务</a>
			</td>
		</tr>
		<tr>
			<td colspan="2" style="text-align: left;">
				任务状态:
				<label class="showState" style="color:red;">正在初始化。。。</label>
			</td>
		</tr>
</table>
	</form>
</body>


</html>